<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<input onchange="upload(this)" type="file" accept="image/*" />

<script src="js/dist/lrz.bundle.js"></script>
<img src="">
<script>
    function upload (e) {
        console.log(e);
        lrz(e.files[0],{quality:0.1})
                .then(function (rst) {
                    // 处理成功会执行
                    var src= rst.base64;
                    var img = document.getElementsByTagName('img')[0].src=src;
                })
                .catch(function (err) {
                    // 处理失败会执行
                })
                .always(function () {
                    // 不管是成功失败，都会执行
                });
    };

</script>
</body>
</html>